package com.company.indicationshots.util;

//E22模块属性对应关系类
public class E22ParamMatch {

    public static String baudRateBit(String baudRate) {
        String babit = null;
        switch (baudRate) {
            case "1200bps":
                babit = "000";
                break;
            case "2400bps":
                babit = "001";
                break;
            case "4800bps":
                babit = "010";
                break;
            case "9600bps":
                babit = "011";
                break;
            case "19200bps":
                babit = "100";
                break;
            case "38400bps":
                babit = "101";
                break;
            case "57600bps":
                babit = "110";
                break;
            case "115200bps":
                babit = "111";
                break;
        }
        return babit;
    }

    public static String baudRateValue(String baudRateBit) {
        String baValue = null;
        switch (baudRateBit) {

            case "000":
                baValue = "1200bps";
                break;

            case "001":
                baValue = "2400bps";
                break;

            case "010":
                baValue = "4800bps";
                break;

            case "011":
                baValue = "9600bps";
                break;

            case "100":
                baValue = "19200bps";
                break;

            case "101":
                baValue = "38400bps";
                break;

            case "110":
                baValue = "57600bps";
                break;

            case "111":
                baValue = "115200bps";
                break;

        }
        return baValue;
    }

    public static String checkoutBit(String checkout) {
        String chbit = null;
        switch (checkout) {
            case "8N1":
                chbit = "00";
                break;
            case "8O1":
                chbit = "01";
                break;
            case "8E1":
                chbit = "10";
                break;
        }
        return chbit;
    }

    public static String checkoutValue(String checkoutBit) {
        String chValue = null;
        switch (checkoutBit) {
            case "00":
                chValue = "8N1";
                break;
            case "01":
                chValue = "8O1";
                break;
            case "10":
                chValue = "8E1";
                break;
        }
        return chValue;
    }

    public static String airSpeedBit(String airSpeed) {
        String aibit = null;
        switch (airSpeed) {
            case "2.4kbps":
                aibit = "010";
                break;
            case "4.8kbps":
                aibit = "011";
                break;
            case "9.6kbps":
                aibit = "100";
                break;
            case "19.2kbps":
                aibit = "101";
                break;
            case "38.4kbps":
                aibit = "110";
                break;
            case "62.5kbps":
                aibit = "111";
                break;
        }
        return aibit;
    }

    public static String airSpeedValue(String aiSpeedBit) {
        String aiValue = null;
        switch (aiSpeedBit) {
            case "010":
                aiValue = "2.4kbps";
                break;
            case "011":
                aiValue = "4.8kbps";
                break;
            case "100":
                aiValue = "9.6kbps";
                break;
            case "101":
                aiValue = "19.2kbps";
                break;
            case "110":
                aiValue = "38.4kbps";
                break;
            case "111":
                aiValue = "62.5kbps";
                break;
        }
        return aiValue;
    }

    public static String baleLengthValue(String baleLengthBit) {
        String blValue = null;
        switch (baleLengthBit) {
            case "00":
                blValue = "240bytes";
                break;
            case "01":
                blValue = "128bytes";
                break;
            case "10":
                blValue = "64bytes";
                break;
            case "11":
                blValue = "32bytes";
                break;
        }
        return blValue;
    }

    public static String modulePowerBit(String modulePower) {
        String modulePowerBit = null;
        switch (modulePower) {
            case "30dBm":
                modulePowerBit = "00";
                break;
            case "27dBm":
                modulePowerBit = "01";
                break;
            case "24dBm":
                modulePowerBit = "10";
                break;
            case "21dBm":
                modulePowerBit = "11";
                break;
        }
        return modulePowerBit;
    }

    public static String modulePowerValue(String modulePowerBit) {
        String mpValue = null;
        switch (modulePowerBit) {
            case "00":
                mpValue = "30dBm";
                break;
            case "01":
                mpValue = "27dBm";
                break;
            case "10":
                mpValue = "24dBm";
                break;
            case "11":
                mpValue = "21dBm";
                break;
        }
        return mpValue;
    }

    public static String WORCycleValue(String WORCycleBit) {
        String WORCycleValue = null;
        switch (WORCycleBit) {
            case "000":
                WORCycleValue = "500ms";
                break;
            case "001":
                WORCycleValue = "1000ms";
                break;
            case "010":
                WORCycleValue = "1500ms";
                break;
            case "011":
                WORCycleValue = "2000ms";
                break;
            case "100":
                WORCycleValue = "2500ms";
                break;
            case "101":
                WORCycleValue = "3000ms";
                break;
            case "110":
                WORCycleValue = "3500ms";
                break;
            case "111":
                WORCycleValue = "4000ms";
                break;
        }
        return WORCycleValue;
    }

    public static String baleLengthBit(String baleLength) {
        String baleLengthBit = null;
        switch (baleLength) {
            case "240bytes":
                baleLengthBit = "00";
                break;
            case "128bytes":
                baleLengthBit = "01";
                break;
            case "64bytes":
                baleLengthBit = "10";
                break;
            case "32bytes":
                baleLengthBit = "11";
                break;
        }
        return baleLengthBit;
    }

    public static String WORCycleBit(String WORCycle) {
        String WORCycleBit = null;
        switch (WORCycle) {
            case "500ms":
                WORCycleBit = "000";
                break;
            case "1000ms":
                WORCycleBit = "001";
                break;
            case "1500ms":
                WORCycleBit = "010";
                break;
            case "2000ms":
                WORCycleBit = "011";
                break;
            case "2500ms":
                WORCycleBit = "100";
                break;
            case "3000ms":
                WORCycleBit = "101";
                break;
            case "3500ms":
                WORCycleBit = "110";
                break;
            case "4000ms":
                WORCycleBit = "111";
                break;
        }
        return WORCycleBit;
    }


}
